
<div id="clanakopsirno">

    <p style="margin-bottom: 0;"> <a href="" ><?=$article['column_name']?></a> / <a href="#" ><?=$article['subcolumn_name']?></a> / <a href="#" ><?=$article['uptitle']?></a></p>

    <h3><?=$article['uptitle']?></h3>
    <h2><?=$article['title']?></h2>

    <p class="introtxt" style="margin-bottom: 0;"><?=$article['intro']?></p>

    <?php 
        $dan = date('l', $article['datepublish']);
        $update_dan = date('l', $article['modified']);
        $mjesec = date('m', $article['datepublish']);
        $update_mjesec = date('m', $article['modified']);
        $dan_broj = date('d', $article['datepublish']);
        $update_dan_broj = date('d', $article['modified']);
        $godina = date('Y', $article['datepublish']);
        $update_godina = date('Y', $article['modified']);
        $datum = date('d.m.Y - H:i', $article['datepublish']);
        $update_datum = date('d.m.Y - H:i', $article['modified']);
        $sat = date('H:i', $article['datepublish']);   
        $update_sat = date('H:i', $article['modified']);   
    ?>

    <span class="podaci">
        <?=transDays($dan,'cir');?>, 
        <?=$dan_broj?>.<?=$mjesec?>.<?=$godina?> u <?=$sat?>
        <?
            if($article['modified']!= NULL){?>
            | Ажуриран  

            <?=transDays($update_dan,'cir');?>, 
            <?=$update_dan_broj?>.<?=$update_mjesec?>.<?=$update_godina?> u <?=$update_sat?>
            <?}
        ?>

        &nbsp;&nbsp; Пише <span class="author"><?=$article['firstname'].' '.$article['lastname']?></span>
    </span>
    <div class="separator clearfix" id="naslovnaimg" style="border: 0; width: 537px; height: 330px; margin-bottom: 0;">
        <?php	

            switch($article_media[0]['type']){
                case 'img':?>
                <img src="<?=$url.'cache/'.$this->img_map->showImage($article_media[0]['file'],537,330,"exacttop");?>" alt="<?=$article_media[0]['caption']?>" title="<?=$article_media[0]['caption']?>" width="537" height="330" /><?
                    break;

                case 'yt':?>
                <img src="<?=$url.'cache/'.$this->img_map->showImage($article_media[0]['file'].".jpg",537,330,"exacttop");?>" alt="<?=$article_media[0]['caption']?>" title="<?=$article_media[0]['caption']?>" width="537" height="330" /><?
                    break;
            }
        ?>
        <div class="nadnaslov overwrite"><?=$article_media[0]['caption']?></div>
    </div>
    <div class="separator" style="float : none; height: 0;"></div>

    <div id="text_hold">

        <?

            // explode into array of paragraph
            $myArticle = explode('</p>',$article['text']);
            
            //remove lat empty paragrafs
            if($myArticle[count($myArticle)-1]==""){
                unset($myArticle[count($myArticle)-1]);
            }
            //echo 'broj p:'. count($myArticle).'<br /><br />';
            
            $paragrafs = array();
            
            foreach ($myArticle as $p){
                 $txt = explode('<p>',$p);
                 $paragrafs[] = $txt[1];
            }
            
            foreach ($paragrafs as $count=>$p){
                
                foreach($article_media as $row){
                    
                    if( $row['sort'] == ($count+1)){
                        ?><p><span class="art_<?=$row['position']?>">
                            <?
                                switch ($row['position']){
                                    case 'left': $w=180; $h=140; break;
                                    case 'center': $w=537; $h=330; break;
                                    case 'right': $w=180; $h=140; break;
                                }
                                
                                
                            ?>
                            <img src="<?=$url.'cache/'.$this->img_map->showImage($row["file"],$w,$h,"exacttop");?>" alt="<?=$row['caption']?>" title="<?=$row['caption']?>" width="<?=$w?>" height="<?=$h?>" />
                        </span></p><?
                    }
                }
                
                echo '<p>'.$p.'</p>'; 
            }
            
		
         // UCITAJ KOMENTARE CLANKA
		
         $this->load->view("article/comments");
           
        ?>
    
    	
    

    </div>
</div>
